CXX=g++
CPPFLAGS=-g -std=c++11 -lrt
CEXECS=	001_BST2DList \
	002_MINstack  \
	003_SumSubArray \
	004_TreeSumPath \
	005_smallestK	\
	006_tencent_array \

CXXEXECS = 007_joined_linkedlist 		\
	   009_is_post_traverse	 		\
	   010_reverse_words	 		\
	   011_max_distance_among_nodes  	\
	   012_sum_integers			\
	   013_list_last_k			\
	   014_sum_to_number			\
	   015_tree_iso				\
	   016_level_order_traversal		\
	   017_first_once_char			\
	   018_delete_circle_numbers		\
	   019_fastest_Fibonacci		\
	   020_string_to_number

all: $(EXECS) $(CXXEXECS)

$(EXECS) : %:%.o
	$(CXX) $(CPPFLAGS) -o $@ $<

%.o:%.c
	$(CXX) $(CPPFLAGS) -o $@ -c $<
       
$(CXXEXECS) : %:%.o
	$(CXX) $(CPPFLAGS) -o $@ $<

%.o:%.cpp
	$(CXX) $(CPPFLAGS) -o $@ -c $<

clean:
	rm -fr *.o
	rm -fr $(EXECS)
